#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include"vector.h"
#include<vector>

using namespace std;
void Test1()
{
	bit::vector<int> v;



	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);


	v.reserve(8);
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);

	for (auto e : v)
	{
		cout << e << ' ';
	}
	cout << endl;
	for (bit::vector<int>::iterator t = v.begin(); t < v.end(); t++)
	{
		cout << *t << ' ';
	}
	cout << endl;

	for (int i = 0; i < v.size(); i++)
	{
		cout << v[i] << ' ';
	}
}
void Test2()
{
	vector<int> v;
	for (int i = 0; i < 9; i++)
	{
		v.push_back(i);
		cout << v.capacity() << endl;
	}
	v.reserve(13);
	v.push_back(1); 
	v.push_back(2); 
	v.push_back(3);
}

void Test3()
{
	vector<int> v;



	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);


	v.resize(8);
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);

	for (auto e : v)
	{
		cout << e << ' ';
	}
	cout << endl;
	for (vector<int>::iterator t = v.begin(); t < v.end(); t++)
	{
		cout << *t << ' ';
	}
	cout << endl;

	for (int i = 0; i < v.size(); i++)
	{
		cout << v[i] << ' ';
	}
}
void Test4()
{
	bit::vector<int> v(1,0);
	cout << v[0] << endl;
	v.pop_back();
	cout << v[0] << endl;

}
void Test5()
{
	
	//bit::vector<int> v1(10, 5);
	//bit::vector<int> v2(v1);
	//bit::vector<int> v3(v1.begin(),v1.end());

	vector<int> v1;
	for (int i = 0; i < 10; i++)
	{
		v1.push_back(i);
	}
	vector<int> v2(v1);
	vector<int> v3(v1.begin(),v1.end());
	for (auto e : v1)
	{
		cout << e << ' ';
     }
	cout << endl;
	for (auto e : v2)
	{
		cout << e << ' ';
	}
	cout << endl;

	for (auto e : v3)
	{
		cout << e << ' ';
	}


	bit::vector<int> bv1;
	for (int i = 0; i < 10; i++)
	{
		bv1.push_back(i);
	}
	bit::vector<int> bv2(bv1);
	bit::vector<int> bv3(bv1.begin(), bv1.end());
	for (auto e : bv1)
	{
		cout << e << ' ';
	}
	cout << endl;
	for (auto e :bv2)
	{
		cout << e << ' ';
	}
	cout << endl;

	for (auto e : bv3)
	{
		cout << e << ' ';
	}


}
void Test6()
{
	bit::vector<int> v1;
	for (int i = 1; i < 5; i++)
	{
		v1.push_back(i);
	}
	bit::vector<int> v2;
	for (int i = 5; i < 10; i++)
	{
		v2.push_back(i);
	}
	v1.print();
	v2.print();
	//swap(v1, v2);
}
void Test7()
{
	bit::vector<int> v(10,3);
	v.insert(v.begin(), 0);
	v.print();
	v.insert(v.begin() + 2, 0);
	v.print();
	v.insert(v.end(), 0);
	v.print();

	vector<int> b(10, 3);
	b.insert(b.end(), 0);
	for (auto e : b)
	{
		cout << e << ' ';
	}
}
void Test8()
{
	bit::vector<int> v1;
	for (int i = 0; i < 10; i++)
	{
		v1.push_back(i);
	}
	v1.print();
	v1.erase(v1.begin()+5);
	v1.print();

	v1.erase(v1.begin());
	v1.print();

	v1.erase(v1.begin()+1);
	v1.print();

	v1.erase(v1.end() - 1);
	v1.print();
	v1.erase(v1.end() - 1); v1.erase(v1.end() - 1); v1.erase(v1.end() - 1); v1.erase(v1.end() - 1);
	v1.erase(v1.end() - 1);
	v1.print();
	v1.erase(v1.end() - 1);
	v1.print();
	v1.erase(v1.end() - 1);
	v1.print();


}
void Test10()
{
	 bit::vector<int> v;
	 v.reserve(10);
	 for (int i = 0; i < 10; i++)
	 {
		 v.push_back(i);
	 }
	bit::vector<int> b(v);
	b.print();
	v = b;
	v.print();
}
void Test11()
{
	bit::vector<int> v3(10,0);

	bit::vector<int> v1;
	for (int i = 0; i < 10; i++)
	{
		v1.push_back(i);
	}
	bit::vector<int> v2;
	v2.print();
	v2 = v1;
	v2.print();

	v2.swap(v3);
	v2.print();

}
void Test12()
{
	bit::vector<string> b;
	b.push_back("aaaa");
	b.push_back("bbbbb");
	b.push_back("cccccc");
	b.push_back("ddddddd");
	b.push_back("ffffffff");



	b.print();
}
int main()
{
	Test12();
	
	return 0;
}